package util;

import java.io.IOException;

public class TestCloner {
    public static void main(String[] args) throws CloneNotSupportedException {
        try {
            Person p1 = new Person("Alice", 30, new int[]{90, 80, 85});
            Person p2 = ObjectCloner.clone(p1);

            System.out.println("p1: " + p1);
            System.out.println("p2: " + p2);
            System.out.println("p1 != p2: " + (p1 != p2));
            System.out.println("p1.scores != p2.scores: " + (p1.getScores() != p2.getScores()));

        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        System.out.println();
        Person p1 = new Person("Alice", 30, new int[]{90, 80, 85});
        Person p2 = (Person) p1.clone();
        System.out.println("p1: " + p1);
        System.out.println("p2: " + p2);
        System.out.println("p1 != p2: " + (p1 != p2));
        System.out.println("p1.scores != p2.scores: " + (p1.getScores() != p2.getScores()));
    }
}
